﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.ServiceModel;
using System.Text;
using System.Windows.Forms;
using MediaController.Server.Core;

namespace MediaController.Server.UI
{
    public partial class ServiceHostForm : Form
    {
        //private readonly ServiceHost _serviceHost;
        //private readonly ConsoleRedirector _consoleRedirector;
      
        //public ServiceHostForm()
        //{
        //    InitializeComponent();
        //     _consoleRedirector = new ConsoleRedirector(textBox1);
        //     Console.SetOut(_consoleRedirector);

        //    _serviceHost = new ServiceHost(typeof(MediaControllerService));
        //    _serviceHost.Opened += ServiceHostOpened;
        //    _serviceHost.Closed += ServiceHostClosed;
        //    _buttonOperation_Click(null, null);
        //}

        //private void _buttonOperation_Click(object sender, EventArgs e)
        //{
        //    switch (_buttonOperation.Text)
        //    {
        //        case "Strat":
        //            Logger.Log(string.Format("Starting service...");
        //            _serviceHost.Open();
        //            break;
        //        case "Stop":
        //            Logger.Log(string.Format("Stopping service...");
        //            _serviceHost.Close();
        //            break;
        //    }
        //}

        //void ServiceHostClosed(object sender, EventArgs e)
        //{
        //    Logger.Log(string.Format("Service stopped");
        //    _buttonOperation.Text = "Start";
        //}

        //void ServiceHostOpened(object sender, EventArgs e)
        //{
        //    Logger.Log(string.Format("Service started");
        //    _buttonOperation.Text = "Stop";
        //}
    }
}
